<?php
/*
 *	Author: Shaun Farrell [www.parkitdc.com]
 *	Description: Loads parking meter data from PMI Parking Management Inc.
 *
 *	THIS IS FOR DATA LOADING ONLY!
 *
 */
 
require_once('scripts_configs.php');
$xml =  simplexml_load_file("http://locations.pmi-parking.com/garages.xml");
for($i=0; $i < count($xml->ID); $i++) {
	$sql = "INSERT INTO Garage (COMPANY, GARAGENUM, LOCATION, LATITUDE, LONGITUDE) VALUES (
		'".mysql_real_escape_string('Parking Management, Inc.')."',
		'".mysql_real_escape_string($xml->ID[$i])."',
		'".mysql_real_escape_string($xml->Address[$i])." Washington, DC',
		'".mysql_real_escape_string($xml->point[$i]['lat'])."',
		'".mysql_real_escape_string($xml->point[$i]['lng'])."');";
		
	mysql_query($sql);
}
echo "Completed";
?>
